log using "C:\Users\J.PARK\Dropbox\Discrimination Project_for me\Organizational Diversity\2023 Version_Merging\FINAL\CFA_2012.smcl", replace  


import delimited "C:\Users\J.PARK\Dropbox\DISCRIMINATION PROJECT\FEVS\FEVS_2010-2019\FEVS2012_PRDF.csv"
drop if q17=="X"
drop if q17==""
drop if q37=="X"
drop if q37==""
drop if q38=="X"
drop if q38==""
drop if q15=="X"
drop if q15==""
drop if q22=="X"
drop if q22==""
drop if q25=="X"
drop if q25==""
drop if q33=="X"
drop if q33==""
drop if q48==.
drop if q49==.
destring q17, replace
destring q37, replace
destring q38, replace
destring q15, replace
destring q22, replace
destring q25, replace
destring q33, replace
drop if q55=="X"
drop if q55==""
drop if q45=="X"
drop if q45==""
drop if q34=="X"
drop if q34==""
destring q55, replace
destring q45, replace
destring q34, replace
drop if dsuper=="X"
drop if dsuper==""
drop if dsex=="X"
drop if dsex==""
drop if dminority==.
gen minority = 0 if dminority==2
replace minority = 1 if dminority==1
gen gender = 1 if dsex == "B"
replace gender = 0 if dsex == "A"
gen supervisor = 1 if dsuper == "B" 
replace supervisor = 0 if dsuper == "A"

svyset [pweight=postwt]

svy linearized : sem (JUSTICE -> DISTRIBUTIVE, ) (JUSTICE -> PROCEDURAL, ) (JUSTICE -> INTERPERSONAL, ) (DISTRIBUTIVE -> q22, ) (DISTRIBUTIVE -> q25, ) (DISTRIBUTIVE -> q33, ) (PROCEDURAL -> q15, ) (PROCEDURAL -> q17, ) (PROCEDURAL -> q37, ) (PROCEDURAL -> q38, )(INTERPERSONAL -> q48, ) (INTERPERSONAL -> q49, ), standardized latent(JUSTICE DISTRIBUTIVE PROCEDURAL INTERPERSONAL ) nocapslatent

estat gof, stats(all)

predict justice, latent(JUSTICE)

svy linearized : sem (DIVERSITY -> q34, ) (DIVERSITY -> q45, ) (DIVERSITY -> q55, ), standardized latent(DIVERSITY) nocapslatent

estat gof, stats(all)

predict diversity, latent(DIVERSITY)

keep if agency =="AM" | agency =="IB" | agency =="FQ" | agency =="ED" | agency =="DN" | agency =="HU" | agency =="ST" | agency =="EP" | agency =="EE" | agency =="FC" | agency =="DR" | agency =="FT" | agency =="GS" | agency =="NN" | agency =="NQ" | agency =="CU" | agency =="NL" | agency =="NF" | agency =="NU" | agency =="OM" | agency =="BG" | agency =="RR" | agency =="SE" | agency =="SB" | agency =="SZ" | subelem =="DD10" | subelem =="DD63" | subelem =="DD35" | subelem =="DD04" | subelem =="DD07" | subelem =="DD27" | subelem =="DD60" | subelem =="AG10" | subelem =="AG01" | subelem =="AG04" | subelem =="AG05" | subelem =="AG06" | subelem =="CM03" | subelem =="CM05" | subelem =="CM06" | subelem =="CM07" | subelem =="CM11" | subelem =="DD16" | subelem =="HE01" | subelem =="HE03" | subelem =="HE04" | subelem =="HE05" | subelem =="HE06" | subelem =="HE07" | subelem =="HE08" | subelem =="HE09" | subelem =="HS04" | subelem =="HS05" | subelem =="HS14" | subelem =="HS01" | subelem =="HS03" | subelem =="HS02" | subelem =="HS06" | subelem =="HS12" | subelem =="HS10" |subelem =="DJ15" | subelem =="DJ03" | subelem =="DJEA" | subelem =="DJ12" | subelem =="DJ09" | subelem =="DJ02" | subelem =="DJ08" | subelem =="DJ11" | subelem =="DL03" | subelem =="DL02" | subelem =="DL10"| subelem =="DL09" | subelem =="DL04" | subelem =="DL06" | agency =="AF" | agency =="AR" | subelem =="IN03" | subelem =="IN01" | subelem =="IN02" | subelem =="IN06" | subelem =="IN04" | subelem =="IN05" | subelem =="IN10" | agency =="NV" | subelem =="TR01" | subelem =="TR03" | subelem =="TR06" | subelem =="TR11" | subelem =="TR09" | subelem =="TR07" | subelem =="TD02" | subelem =="TD03" | subelem =="TD04" | subelem =="VA03" | subelem =="VA02"

svy linearized : sem (JUSTICE -> DISTRIBUTIVE, ) (JUSTICE -> PROCEDURAL, ) (JUSTICE -> INTERPERSONAL, ) (DISTRIBUTIVE -> q22, ) (DISTRIBUTIVE -> q25, ) (DISTRIBUTIVE -> q33, ) (PROCEDURAL -> q15, ) (PROCEDURAL -> q17, ) (PROCEDURAL -> q37, ) (PROCEDURAL -> q38, )(INTERPERSONAL -> q48, ) (INTERPERSONAL -> q49, ), standardized latent(JUSTICE DISTRIBUTIVE PROCEDURAL INTERPERSONAL ) nocapslatent

estat gof, stats(all)

predict justice2, latent (JUSTICE)

svy linearized : sem (DIVERSITY -> q34, ) (DIVERSITY -> q45, ) (DIVERSITY -> q55, ), standardized latent(DIVERSITY) nocapslatent

estat gof, stats(all)

predict diversity2, latent (DIVERSITY)

sum justice, detail

sum justice2, detail

sum diversity, detail

sum diversity2, detail

corr justice justice2

corr diversity diversity2 

log close


